package com.example.designpattern.strategy_pattern.a;

import org.junit.Test;

/**
 * 测试类
 */
public class ClientTest {

    @Test
    public void myTest() throws Exception{
        MovieTicket movieTicket = new MovieTicket();
        double originalPrice = 60.0; //原始票价

        movieTicket.setPrice(originalPrice);
        System.out.println("原始价为：" + originalPrice);
        System.out.println("---------------------------------");

        movieTicket.setType("student"); //学生票
        System.out.println("折后价为：" + movieTicket.getPrice());
        System.out.println("---------------------------------");

        movieTicket.setType("children"); //儿童票
        System.out.println("折后价为：" + movieTicket.getPrice());


    }
}
